package com.eascs.ticket.schedule.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.eascs.ticket.common.service.BaseSevice;
import com.eascs.ticket.schedule.entity.ScheduleTicketOperator;

@Service
public class ScheduleTicketOperatorService extends BaseSevice {
	public List<Object[]> getScheduleTicketOperatorsByScheduleTicketId(String scheduleTicketId) {
		return this.proxyDao.findObjectsList("sql.schedule.getScheduleTicketOperatorsByScheduleTicketId", scheduleTicketId);
	}

	public List<ScheduleTicketOperator> getScheduleTicketOperatorListByScheduleTicketId(String scheduleTicketId) {
		ScheduleTicketOperator scheduleTicketOperator = new ScheduleTicketOperator();
		scheduleTicketOperator.setScheduleTicketId(scheduleTicketId);
		return this.proxyDao.findEntitysWithAny(scheduleTicketOperator);
	}

	@Transactional(transactionManager = "ticketTransactionManager")
	public ScheduleTicketOperator insertScheduleTicketOperator(ScheduleTicketOperator scheduleTicketOperator) {
		this.proxyDao.insert(scheduleTicketOperator);
		return scheduleTicketOperator;
	}

	@Transactional(transactionManager = "ticketTransactionManager")
	public int removeScheduleTicketOperator(String id) {
		return this.proxyDao.deleteById(ScheduleTicketOperator.class, id);
	}
}
